#ifndef route_h
#define route_h
#include "main.h"
#include <algorithm>
#include "routemap.h"


using namespace std;
namespace vectorMap
{


class Route:public MapObject
{
	public:
	vector<Node*> nodes;
	
	int length();
	
	void prepend(Node* node);
	
	void append (Node* node);
	Route& operator<<(Node* node){
		append(node);
		return *this;
	}
	Route& operator<<(Node& node){
		append(&node);
		return *this;
	}
	Route& operator>>(Node& node){
		prepend(&node);
		return *this;
	}
	
	Route(RouteMap* map);
	Route(Node* node);
	~Route();
		private:
	bool lengthKnown;
	int cachedLength;
};

}

#endif // route_h
